package org.example.lock;

import java.util.concurrent.Semaphore;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author Yyming
 * @version 10.0
 * Created by Yyming on 2020/8/26
 */
public class LockTest {
    public static void main(String[] args) {
        //false为非公平锁 true为公平锁
        ReentrantLock lock = new ReentrantLock(true);
        //加锁
        lock.lock();
        //释放锁
        lock.unlock();
    }
}
